function resolve(dir) {
  return path.join(__dirname, dir);
}
const path = require("path");
module.exports = {
  pages: {
    index: {
      entry: "src/main.js",
      title: "康美心理",
    },
  },
  devServer: {
    open: true,
    port: 1111,
    proxy: {
      "/api": {
        target: "<url>",
        ws: true,
        changOrigin: true,
      },
    },
  },
  configureWebpack: {
    resolve: {
      alias: {
        "@": resolve("src"),
      },
    },
  },
  css: {
    loaderOptions: {
      sass: {
        prependData: `@import "@/styles/index.scss";`,
      },
    },
  },
  outputDir: "dist",
  publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
  pwa: {
    iconPaths: {
      favicon32: "favicon.ico",
      favicon16: "favicon.ico",
      appleTouchIcon: "favicon.ico",
      maskIcon: "favicon.ico",
      msTileImage: "favicon.ico",
    },
  },
};
